package com.my.commonlibrary.utils;

import android.content.Context;
import android.view.WindowManager;

/**
 * Author : Cooper
 * Time : 2016/11/16  10:59
 * Description : 屏幕工具类
 */

public class ScreenUtil {

    /**
     * 获取屏幕宽度
     * @param context
     * @return
     */
    public static int getScreenWidth(Context context) {
        return ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();
    }

    /**
     * 获取屏幕高度
     * @param context
     * @return
     */
    public static int getScreenHeight(Context context) {
        return ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getHeight();
    }
}
